<template>
  <div class="personal-center">
    <van-nav-bar safe-area-inset-top title="个人中心" left-arrow @click-left="onClickLeft" />
    <div class="background">
      <div class="avatar-area">
        <div class="avatar-box">
          <div class="avatar">
            <van-image
              round
              width="60"
              fit="cover"
              height="60"
              src="http://192.9.231.82:9000/garen/20230825/0c81d3e42dcb041ba9ae9565a570a3d9.jpeg"
            />
          </div>
          <div class="user">
            <span class="user-name">李二狗</span>
            <span class="user-phone">138 8888 8888</span>
          </div>
        </div>
        <div class="room-count">
          <div class="Published">已发布</div>
          <div class="count">100</div>
        </div>
      </div>
    </div>

    <van-cell-group>
      <van-cell title="个人信息" is-link />
      <van-cell title="发布房间" is-link to="/publishRoom" />
      <van-cell title="开发者" is-link />
    </van-cell-group>
  </div>
</template>

<script>
export default {
  name: 'personal',
};
</script>

<script setup>
import { ref, onMounted } from 'vue';
import { useRoute, useRouter } from 'vue-router';

const router = useRouter();

function onClickLeft() {
  router.back();
}

onMounted(() => {
  console.log('个人中心');
});
</script>

<style lang="less" scoped>
.personal-center {
  height: 100%;
  background-color: #f2f2f2;
  .background {
    padding: 15px 12px;
    box-sizing: border-box;
    height: auto;
    border-bottom: 1px solid #ececec;
    width: 100%;
    background-color: #fff;
  }
  .avatar-area {
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    .avatar-box {
      flex: 1;
      height: 100%;
      display: flex;
      align-items: center;
      column-gap: 12px;
      .avatar {
        width: max-content;
        img {
          width: 100%;
        }
      }
      .user {
        display: flex;
        flex-direction: column;
        row-gap: 10px;
        .user-name {
          font-size: 16px;
          color: #000000;
        }
        .user-phone {
          font-size: 14px;
          color: #666;
        }
      }
    }
    .room-count {
      display: flex;
      justify-content: center;
      flex-direction: column;
      width: max-content;
      text-align: center;
      row-gap: 12px;
      .Published {
        font-size: 14px;
        color: #333;
      }
      .count {
        font-size: 13px;
        color: #666;
      }
    }
  }
}
</style>
